package com.lkd.job;

import com.lkd.service.UserService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Component
@Slf4j
public class UserJob {
    @Autowired
    private UserService userService;

    @XxlJob("workCountInitJobHandler")
    public ReturnT<String> workCountInitJobHandler(String param){
        XxlJobLogger.log("每日工单量列表初始化");
        //工单初始化
        userService.workCountInit(LocalDate.now());
        return ReturnT.SUCCESS;
    }
}
